//
//  Environment.h
//  ShopInMall_OC
//
//  Created by Sailer Guo on 2019/10/16.
//  Copyright © 2019 Sailer Guo. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "EnvironmentConstants.h"
//#import "HTTPService.h"

#import "HTTPService+SPOrder.h"
#import "HTTPService+Login.h"
#import "HTTPService+Member.h"

#import "SPPayService.h"
#import "SPCMSService.h"


@protocol SPThirdServiceConfig <NSObject>

@property (nonatomic,copy) NSString * _Nullable appKey;
@property (nonatomic,copy) NSString * _Nonnull appSecret;

@end

NS_ASSUME_NONNULL_BEGIN

// 注意也不要过度设计
// environment 配置一些环境变量，如自定义请求超时时间，配置类等待。可以用于持有全局的若业务逻辑。
@interface Environment : NSObject

#warning 还要补充的内容
/*
 1. 检查应用当前的网络状态；
 */

@property (nonatomic,copy) NSString *appId;
@property (nonatomic,copy) NSString *currency;
@property (nonatomic,copy) NSString *language;
@property (nonatomic,copy) NSString *oauthToken;
@property (nonatomic,copy) NSString *buildVersion;


//@property (nonatomic,strong,readonly) SPUserInfoModel *currentUser;

@property (nonatomic,assign,readonly) EnvironmentType currentEnv;

@property (nonatomic,nullable,strong,readonly) HTTPService *apiService;
@property (nonatomic,nullable,strong,readonly) SPPayService *payService;
@property (nonatomic,nullable,strong,readonly) SPCMSService *cmsService;

@property (nonatomic,strong,readonly) RACSubject *networkMonitoringSignal;


+ (instancetype)sharedInstance;

- (id<SPThirdServiceConfig>)thridServiceConfig:(SPThirdService)serviceType;

- (void)switchServiceEnv:(EnvironmentType)env;

@end

NS_ASSUME_NONNULL_END
